var aaa = "#fUI/UIWindow/AriantMatch/characterIcon/5#";
var yun = "#fUI/UIWindow/Quest/icon8/0#"; ////红沙漏
var yun2 = "#fUI/UIWindow/Quest/icon8/0#"; ////蓝指标
var yun8 = "#fUI/UIWindow/MonsterBook/arrowLeft/normal/0#"; ////金左指标
var yun9 = "#fUI/UIWindow/MonsterBook/arrowRight/normal/0#"; ////金右指标
var PK点 = 100;
function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;

		if (status == 0) {
			var text = "#e#r " + "[个人pk乱斗]\r\n#d#n 注意:活动为服务器#r每小时10分开始至每小时20分结束!\r\n #b不是特定时间是不开放玩家进入的!" + "\r\n" + "#n 参加个人乱斗可以获得mvp称号，戒指，椅子，斗神证物\r\n#g 下面就让我来为您展示一下丰富的战利品吧~\r\n#v3700341# #v3700342# #v3700343# #v3700344# #v3700345# #v3700346# #v3700347# #v3014011# #v1115012# #v1115100# #v1115013# #v1115101# #v1115014# #v1115102# #v4310015# \r\n#r温馨提示：#d许多装备制造需要斗神证物";
			text += "\r\n#b#L4#" + yun2 + "- 我的PK信息#l";
			text += "\r\n#b#L1#" + yun2 + "- 进入个人PK乱斗地图    -  #r[老司机请小心开车]#l\r\n";
			text += "#b#L2#" + yun2 + "#d- 我要换取伤害皮肤      - #k [使用pk热力值换取] #l\r\n";
			text += "#b#L3#" + yun2 + "#d- 我要换取斗神证物      - #k [使用pk热力值换取] #l\r\n";
			text += "#b#L5#" + yun2 + "#d- 我要换取PK称号        - #k [使用pk热力值换取] #l\r\n";
			cm.sendSimple(text);
		} else if (status == 1) {
			switch (selection) {
			case 1:
				//cm.warp(867111039);
				cm.dispose();
				cm.openNpc(9070003, "进入PK");
				break;
			case 2: //换取
				cm.dispose();
				cm.openNpc(9070003, "pk热力伤害皮肤");
				break;
			case 3:
				if (cm.getPvpNx() >= PK点) {
					cm.gainPvpNx(-PK点);
					cm.gainItem(4310015, 1);
					cm.sendOk("成功消耗了" + PK点 + "点PK热力值兑换了 #v4310015#x1");
				} else {
					cm.sendOk("你的PK热力值不够" + PK点 + "点哟\r\n当前的PK热力值是" + cm.getPvpNx() + " 点");
				}
				cm.dispose();
				break;
			case 4:
				cm.dispose();
				cm.sendOk("我的PK信息:\r\n总杀人次数: " + cm.getPvpKills() + " 次\r\n最高连续击杀记录: " + cm.getPvpVictory() + " 次\r\n被杀次数: " + cm.getPvpDeaths() + "\r\nPK热力值:" + cm.getPvpNx());
				break;
			case 5: //换取
				cm.dispose();
				cm.openNpc(9070003, "pk热力换称号");
				break;
			default:
				cm.sendOk("管理员正在准备中.请期待");
				cm.dispose();
			}
		}
	}
}
